home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts10-07
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++,comp.os.linux.development.apps,comp.os.linux.misc
- Subject: Re: Are str* functions okay in C++?
- Date: Sat, 09 Mar 96 18:14:20 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hshqa$pmm@sam.inforamp.net>
- References: <4hpvi0$gt6@news.platinum.com>
- NNTP-Posting-Host: ts10-07.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4hpvi0$gt6@news.platinum.com>,
- dcmark@platinum.com (Mark Juric) wrote:
- >Hi all,
- > I am relatively new to C++ and I'm having a heck of a time porting a C
- >program to C++. I have a function that opens a man page and tries to
- >determine if it points to another man page. I use strtok and strcpy in the
- >function. It works fine under Solaris 2.x, however, under Linux 1.2.x or
- >1.3.x it chokes on a delete[] statement after several hundred iterations.
- >Here's the function. It dies under Linux on the delete[] path; statement.
-
- I'm thinking that maybe the delete[] isn't the problem, but that when you
- allocated the path array, the allocation may have failed. Only you can check
- this. I don't know the implementation and I don't have Linux running in my
- office.
-
- I suggestion is to give up on old C functions that do string manipulation and
- begin using a string class. In the MFC library, the class CString is
- great. And in the OWL library, the class String is even better. I don't know
- what's available for Unix or if these classes are appropriate for your
- framework. Maybe somebody else will suggest or send you a string class. HEY
- EVERYBODY, SEND THIS GUY A WORKING LINUX CLASS. Think they heard me?
-
- Agrivar
-